<template>
	<div class="app">
		<h1>我是App组件</h1>
		<h3>孩子给我的电脑:{{computer}}</h3>
		<h3>孩子给我的手机:{{phone}}</h3>
		<Child @send-computer="saveComputer" @send-phone="savePhone"/>
	</div>
</template>

<script>
	import Child from './components/Child'

	export default {
		name:'App',
		components:{Child},
		data() {
			return {
				computer:'',
				phone:''
			}
		},
		methods:{
			saveComputer(value,a,b,c){
				console.log('我是App，我得到了孩子给我的电脑',value,a,b,c)
				this.computer = value
			},
			savePhone(value){
				this.phone = value
			}
		}
	}
</script>

<style>
	.app{
		background-color: gray;
		padding: 20px;
	}
	button{
		margin: 10px;
	}
</style>